package com.homer.commons.sscpprotocol.client;

import java.io.IOException;

public class SscpQuery {
    private SscpTemplate template = new SscpTemplate();

    private byte[] mainDeviceID;
    
    private byte[] slaveDevideID;
    
    private byte key;
   
    private int commandLength;
    
    //private String sourceId;
    
    //private String destId;

    private byte[] content;

    
    public String getEncoding() {
        return this.template.getEncoding();
    }

    public String getHost() {
        return this.template.getHost();
    }

    public int getPort() {
        return this.template.getPort();
    }

    public boolean isBigEndian() {
        return this.template.isBigEndian();
    }

    public void setBigEndian(boolean bigEndian) {
        this.template.setBigEndian(bigEndian);
    }

    public void setEncoding(String encoding) {
        this.template.setEncoding(encoding);
    }

    public void setHost(String host) {
        this.template.setHost(host);
    }

    public void setPort(int port) {
        this.template.setPort(port);
    }

    public SocketOptions getSocketOptions() {
        return this.template.getSocketOptions();
    }

   

    

    public byte[] getMainDeviceID() {
		return mainDeviceID;
	}

	public void setMainDeviceID(byte[] mainDeviceID) {
		this.mainDeviceID = mainDeviceID;
	}

	public byte[] getSlaveDevideID() {
		return slaveDevideID;
	}

	public void setSlaveDevideID(byte[] slaveDevideID) {
		this.slaveDevideID = slaveDevideID;
	}

	public byte getKey() {
		return key;
	}

	public void setKey(byte key) {
		this.key = key;
	}

	public int getCommandLength() {
        return commandLength;
    }

    public void setCommandLength(int commandLength) {
        this.commandLength = commandLength;
    }

    public byte[] getContent() {
        return this.content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    public Result execute() throws IOException {
        return this.template.execute(getKey(), getCommandLength(),getMainDeviceID(),getSlaveDevideID(), getContent());
    }
}
